//package com.applink.sell_proof.adapter;
//
//import java.util.ArrayList;
//import java.util.List;
//import com.applink.sell_proof.EMarketing;
//import com.applink.sell_proof.R;
//import com.applink.sell_proof.database.table.ClaimDBHelper;
//import com.applink.sell_proof.database.table.ProjectDBHelper;
//import com.applink.sell_proof.model.Claim;
//import com.applink.sell_proof.model.NewReward;
//import com.applink.sell_proof.model.Project;
//import com.applink.sell_proof.model.Reward;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.BaseAdapter;
//import android.widget.TextView;
//
//public class RewardCatalogAdapter extends BaseAdapter {
//	private LayoutInflater mInflater;
//	private Reward reward;
//	private List<Project> project;
//	private List<Claim> claim;
//	private ArrayList<NewReward> mData = new ArrayList<NewReward>();
//	private ArrayList<NewReward> rewardProject = new ArrayList<NewReward>();
//	private ArrayList<NewReward> rewardClaim = new ArrayList<NewReward>();
//	private ArrayList<NewReward> rewardAll = new ArrayList<NewReward>();
//	private ArrayList<NewReward> rewardShow = new ArrayList<NewReward>();
//
//	public RewardCatalogAdapter(int position,ArrayList<NewReward> data) {
//		mInflater = LayoutInflater.from(EMarketing.getInstance()
//				.getApplicationContext());
//		this.mData = data;
//
////		project = ProjectDBHelper.getProjectsByStatus("'Approved'");
////		for (int i = 0; i < project.size(); i++) {
////			reward = new Reward();
////			reward.setName(project.get(i).getName());
////			reward.setStatus("Approve");
////			reward.setType("Project");
////			reward.setReward("20");
////			rewardProject.add(reward);
////			rewardAll.add(reward);
////		}
////		claim = ClaimDBHelper.getClaimByStatus("'Submitted'");
////		for (int i = 0; i < claim.size(); i++) {
////			reward = new Reward();
////			reward.setName(claim.get(i).getCustomerCompanyName());
////			reward.setStatus("Submitted");
////			reward.setType("Claim");
////			reward.setReward("20");
////			rewardClaim.add(reward);
////			rewardAll.add(reward);
////		}
//
//		if (position == 0) {
//			rewardShow.clear();
//			rewardShow = mData;
//		} else if (position == 1) {
//			rewardShow.clear();
//			for (int i = 0; i < mData.size(); i++) {
//				if(mData.get(i).getRewardType().contains("Project")){
//					rewardShow.add(mData.get(i));
//				}
//			}
//			//rewardShow = rewardProject;
//
//		} else if (position == 2) {
//			rewardShow.clear();
//			for (int i = 0; i < mData.size(); i++) {
//				if(mData.get(i).getRewardType().contains("Claim")){
//					rewardShow.add(mData.get(i));
//				}
//			}
//			//rewardShow = rewardClaim;
//		}
//	}
//
//	@Override
//	public int getCount() {
//		return rewardShow.size();
//	}
//
//	@Override
//	public Object getItem(int position) {
//		return position;
//	}
//
//	@Override
//	public long getItemId(int position) {
//		return position;
//	}
//
//	@Override
//	public View getView(int position, View convertView, ViewGroup parent) {
//		ChildHolder holder;
//		if (convertView == null) {
//			holder = new ChildHolder();
//			convertView = mInflater.inflate(R.layout.redeem_item, null);
//			holder.reward_type = (TextView) convertView
//					.findViewById(R.id.reward_type);
//			holder.reward_name = (TextView) convertView
//					.findViewById(R.id.reward_name);
//			holder.redeem_product = (TextView) convertView
//					.findViewById(R.id.redeem_product);
//			holder.redeem_status = (TextView) convertView
//					.findViewById(R.id.redeem_status);
//			convertView.setTag(holder);
//		} else {
//			holder = (ChildHolder) convertView.getTag();
//		}
//		holder.reward_type.setText(rewardShow.get(position).getRewardType());
//		//holder.reward_name.setText(rewardShow.get(position).getProgramName());
//		holder.redeem_product.setText(String.valueOf((rewardShow.get(position)
//				.getRewardAmount())));
//		holder.redeem_status.setText(String.valueOf(rewardShow.get(position).getObjectID()));
//
//		return convertView;
//	}
//
//	private class ChildHolder {
//		TextView reward_type;
//		TextView reward_name;
//		TextView redeem_product;
//		TextView redeem_status;
//	}
//
//}
